package com.team.lostProperty.service.impl;

import com.team.lostProperty.entity.Collect;
import com.team.lostProperty.mapper.CollectDao;
import com.team.lostProperty.service.CollectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author duzq
 * @date 2020/7/22 19:14
 */
@Service
public class CollectServiceImpl implements CollectService {

    @Resource
    private CollectDao collectDao;

    @Override
    public List<Collect> getCollectById(long userId, int start) {
        return collectDao.getCollectById(userId,start);
    }

    @Override
    public int getAllCount(long userId) {
        return collectDao.getAllCount(userId);
    }

    @Override
    public List<Collect> getCollectByUser(long userId, int page, int limit) {
        int start = (page - 1) * limit;
        return collectDao.getCollectByUser(userId,start,limit);
    }
}
